#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>


int main()
{
    int n;
    int number = 0;
    int i = scanf("%d", &n);
    for (n = 0; n>>1; n > 0)
    {
        if ((n & 1) != 0)
        {
            number++;
        }

    }
    printf("%d\n", number);
    return 0;
}